//
//  HMAddCaseCell.m
//  仿真开发
//
//  Created by B.HOPE on 2017/3/24.
//  Copyright © 2017年 B.HOPE. All rights reserved.
//

#import "HMAddCaseCell.h"
#import <Masonry.h>

@interface HMAddCaseCell ()

@property (nonatomic, strong) UILabel *leftLabel;

@property (nonatomic, strong) UILabel *rightLabel;

@end

@implementation HMAddCaseCell

- (void)awakeFromNib {
    [super awakeFromNib];
}

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier])
    {
        [self setupUI];
    }
    
    return self;
}

- (void)setupUI
{
    _leftLabel = [[UILabel alloc] init];
    _leftLabel.text = @"疾病类型";
    _leftLabel.font = [UIFont systemFontOfSize:16];
    [self.contentView addSubview:_leftLabel];
    [_leftLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.left.offset(10);
        make.bottom.offset(-10);
    }];
    
    UIImageView *rightView = [[UIImageView alloc] init];
    rightView.image = [UIImage imageNamed:@"position-right"];
    [self.contentView addSubview:rightView];
    [rightView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.equalTo(self);
        make.right.offset(-10);
    }];
    
    _rightLabel = [[UILabel alloc] init];
    _rightLabel.text = @"请选择";
    _rightLabel.font = [UIFont systemFontOfSize:16];
    [self.contentView addSubview:_rightLabel];
    [_rightLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.equalTo(self);
        make.right.equalTo(rightView.mas_left).offset(-10);
    }];
}

- (void)setModel:(HMCaseManageModel *)model
{
    _model = model;
    
    if (model.rightLabel == nil)
    {
        return;
    }
    _rightLabel.text = model.rightLabel;
}

- (void)setTwoModel:(HMCaseTwoModel *)twoModel
{
    _twoModel = twoModel;
    
    if (twoModel.ci3_name == nil)
    {
        return;
    }
    _rightLabel.text = twoModel.ci3_name;
    
}

@end
